/**
 * @(#)ContainerView.java 2011
 *
 *  Copyright 2011 classic-commerce
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *
 *  This class is the container div, which is the highest level container
 * of the web page structure.
 *
 * <pre>
 *      <div id="container">
 *          <div id="header"></div>
 *          <div id="nav"></div>
 *          <div id="banner"></div>
 *          <div id="main-content"></div>
 *          <div id="footer"></div>
 *      </div>
 * </pre>
 *
 * @author: <a href="mailto:richard@ioniq.ca">Richard Mutezintare</a>
 *
 */

package ca.ioniq.client.view;

import ca.ioniq.client.widget.Banner;
import ca.ioniq.client.widget.menu.NavigationMenu;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;

public class ContainerView extends Composite {

    private static final String ID = "container";

    private HeaderView headerView;
    private Banner banner;
    private MainContentView mainContentView;
    private FooterView footerView;

    public ContainerView(final HeaderView headerView, final NavigationMenu menu, final MainContentView mainContentView, final FooterView footerView) {
        FlowPanel panel = new FlowPanel();

        this.headerView = headerView;
        this.banner = new Banner(null);
        this.mainContentView = mainContentView;
        this.footerView = footerView;

        panel.add(headerView);
        panel.add(menu);
        panel.add(banner);
        panel.add(mainContentView);
        panel.add(footerView);
        panel.getElement().setId(ID);

        initWidget(panel);
    }

    public HeaderView getHeaderView() {
        return headerView;
    }

    public MainContentView getMainContentView() {
        return mainContentView;
    }

    public FooterView getFooterView() {
        return footerView;
    }

}
